#ifndef RECBASE_H_
#define RECBASE_H_

#include <vector>
#include <iostream>
#include <streambuf>
#include "rectype.h"
#include "stdfconfig.h"


using namespace std;
using namespace opsrc::stdf;
typedef std::vector<string> StrVec;

namespace opsrc 
{
    namespace stdf
    {

        class RecBase
        {
        public:
            RecBase(stdf_rec stdfrec, int reclen, std::ios::pos_type fileRecFirstBytePosition, int orderindex);
            virtual ~RecBase();

            void setStdfRec(stdf_rec stdfrectype);
            stdf_rec getStdfRec() const;

            int getRecByteCount() const;
            void setRecByteCount(int reclength);

            void setStdfRecTypePair(stdf_rec_typ_pair enValue);
            rec_typ getStdfRecTypePair() const;

            void setRecOrder(int index);
            int getRecOrder() const;

            long getFileRecByteStartPosition() const;

            virtual void readFields(char* buf);

            // print out hexa information
            static void printHexa(char* buffer, int size, ostream& strm);

        protected:
            std::ios::pos_type fileRecByteStartPosition;
            stdf_rec     stdfrec;
            int reclen;  // byte count
            int orderIndex;
            RecBase();
        };


    } // namespace stdf
} // namespace opsrc


#endif /*RECBASE_H_*/
